package com.nrtms.worker.job;

import com.nrtms.service.TestService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHander;
import com.xxl.job.core.log.XxlJobLogger;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 测试job任务
 */
@JobHander(value="testJobHandler")
@Service
public class TestJobHandler extends IJobHandler {

    @Resource
    private TestService testService;

    @Override
    public ReturnT<String> execute(String... strings) throws Exception {
        XxlJobLogger.log("Worker执行开始...");
        testService.testJob();
        XxlJobLogger.log("Worker执行完成...");
        return ReturnT.SUCCESS;
    }
}
